
<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>产品分类</title>
        <link rel="stylesheet" type="text/css" href="../css/content.css">
        <link rel="stylesheet" type="text/css" href="../css/contentblue.css">
        <link rel="stylesheet" type="text/css" href="../css/product.css">
        <link rel="stylesheet" type="text/css" href="../css/shop/product_type.css">
        <script type="text/javascript" src="../js/jquery.min.js"></script>
    </head>
    <body>
        <!--内容框架开始-->
        <div class="WSY_content">
            <!--列表内容大框开始-->
            <div class="WSY_columnbox">
                <!--列表头部切换开始-->
                <div class="WSY_column_header">
                    <div class="WSY_columnnav">
                        <a href="./product_type.html" class="white1">产品分类</a>
                        <a href="./product_type_prop.html">产品属性</a>
                    </div>
                </div><!--列表头部切换结束-->
                <div class="WSY_data">

                    <div class="classificationbox">
                        <div class="content" style="padding:0 10px 20px 10px;">
                            <div style="padding:10px;text-align:right">
                            </div>
                                                            <div class="conterimgbox parent_type 10_1" data-id="10" id="parent_type_10" data-sort="0" data-flag="-1,169" data-level="1" data-top_id="10">
                                    <a href="#" title="衣服" class="icon-text">
                                        衣服                                    </a>
                                    <div class="caozuo_right">
                                        <a href="javascript:;" class="conter_delete btn_delete" data-id="10" data-url="/admin/product.car_group/delete.html" data-confirm_content="子分类也会删除，你确定删除吗？" title="删除"><img src="../img/operating_icon/icon04.png"/> </a>
                                    </div>
                                </div>
                                                                        <div class="conterimgbox child_type 10_2" data-id="12" data-parent-id="10" name="conterimgbox_10" style="" data-flag="-1,167,266" data-level="2" data-top_id="10">
                                            <a href="#" title="文字" class="icon-text">123</a>
                                            <div class="caozuo_right right_10px" style="width:154px;">
                                                <a href="javascript:;" class="conter_delete btn_delete" data-id="12" data-url="/admin/product.car_group/delete.html" title="删除"><img src="../img/operating_icon/icon04.png"/> </a>
                                            </div>
                                        </div>
                                                                                                                                <div class="conterimgbox parent_type 11_1" data-id="11" id="parent_type_11" data-sort="0" data-flag="-1,169" data-level="1" data-top_id="11">
                                    <a href="#" title="鞋子" class="icon-text">
                                        鞋子                                    </a>
                                    <div class="caozuo_right">
                                        <a href="javascript:;" class="conter_delete btn_delete" data-id="11" data-url="/admin/product.car_group/delete.html" data-confirm_content="子分类也会删除，你确定删除吗？" title="删除"><img src="../img/operating_icon/icon04.png"/> </a>
                                    </div>
                                </div>
                                                            
                        </div>
                        <form id="frm_producttype" class="" action="save_type" method="post" >
                            <div class="classify">
                                <div class="list_left">
                                    <p class="classify_text">添加产品分类</p>
                                    <p class="classify_name">分类名称:<input type="text" name="name" value="" id="name"></p>
                                    <span class="classify_span">隶属关系：
                                        <select name="parent_id" id="parent_id">
                                            <option value='-1'>顶级</option><option value='10' >衣服</option><option value='11' >鞋子</option>                                        </select>
                                    </span>

                                    <p class="classify_span">分类图片：</p><br/>
                                    <div class="form-group">
                                        <div>
                                            <input type="hidden" name="imgurl" class="form-control"
                                                   id="js-thumbnail-input">
                                            <div>
                                                <a href="javascript:uploadOneImage('图片上传','#js-thumbnail-input');">
                                                    <img src="../img/default-thumbnail.png"
                                                         id="js-thumbnail-input-preview"
                                                         width="135" style="cursor: pointer"/>
                                                </a>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                                <div class="classify_content-input">
                                    <button type="button" class="classify_input" id="saveProtype">保存分类</button>
                                    <button type="button" class="classify_input2" id="returnBack">返回</button>
                                </div>
                        </form>

                    </div>
                </div>

            </div>
        </div>
        <script type="text/javascript" src="../js/layer/layer.js"></script>
        <script type="text/javascript" src="../js/sugao.js"></script>
        <script>            
            $(function () {
                //提交
                $("#saveProtype").click(function () {
                    var pattern = /[`~!@#$%^&*()+<>?:"{},.\/;'[\]]/im;
                    var name = $("#name").val();
                    if (name == "") {
                        alert("类型名称必填！");
                        return;
                    } else if (pattern.test(name)) {
                        alert('提示信息：您输入的数据含有非法字符！');
                        name = "";
                        return;
                    }
                    $("#parent_id").removeAttr("disabled");
                    $("#frm_producttype").submit();
                });                         
            });
        </script>
    </body>
</html>